<nav aria-label="Page navigation" class="text-right">
    <ul class="pagination">
        {% if list.has_previous %}
            <li>
                <a href="?page={{ list.previous_page_number }}" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
        {% else %}
            <li>
                <a href="#" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
        {% endif %}
        <li>
            <a href="?page=1" aria-label="Previous">
                <span aria-hidden="true">首页</span>
            </a>
        </li>
        {% for num in nums %}
            {% if  num %}
                {% ifequal num  list.number %}
                    <li><a href="#">{{ num }}</a></li>
                {% else %}
                    <li><a href="?page={{ num }}">{{ num }}</a></li>
                {% endifequal %}
            {% else %}
                <li><a href="#">...</a></li>
            {% endif %}
        {% endfor %}
        <li>
            <a href="?page={{ list.paginator.num_pages }}" aria-label="Previous">
                <span aria-hidden="true">末页</span>
            </a>
        </li>
        {% if list.has_next %}
            <li>
                <a href="?page={{ list.next_page_number }}"
                   aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
        {% else %}
            <li>
                <a href="#" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
        {% endif %}
    </ul>
</nav>
